<%@ page language="java" contentType="text/html;"
    pageEncoding="UTF-8"
    import="com.facebook.api.schema.*" 
	import="com.facebook.api.*"
    import="java.util.*"
  %>
<% ArrayList <User> users = (ArrayList <User>) request.getAttribute("users"); %>
 <link href="css/main.css" rel="stylesheet" type="text/css">
 
<script src="http://static.ak.facebook.com/js/api_lib/v0.3/FeatureLoader.js" type="text/javascript"></script>
<script type="text/javascript">
	FB_RequireFeatures(["CanvasUtil"], function(){
	FB.XdComm.Server.init('<%= request.getAttribute("FB_SERVER_URL") %>xd_receiver.htm');
	FB.CanvasClient.startTimerToSizeToContent();
});
</script>
 
  <!-- Begin Wrapper -->
   <div id="wrapper">
   
         <!-- Begin Header -->
         <div id="header">
		 
		        
			   
		 </div>
		 <!-- End Header -->
		 
		 <!-- Begin Naviagtion -->
         <div id="navigation">
         	<ul class="nav">
				<li><a href="<%= request.getAttribute("FB_APP_URL") %>" target="_top">Home</a></li>
				<li><a class="current" href="<%= request.getAttribute("FB_APP_URL") %>BaffesServlet" target="_top">Baffes</a></li>
				<li><a href="<%= request.getAttribute("FB_APP_URL") %>GrapheServlet" target="_top">Graphe des amis</a></li>
				<li><a href="<%= request.getAttribute("FB_APP_URL") %>HistoriqueServlet" target="_top">Historique</a></li>
				<li><a href="<%= request.getAttribute("FB_APP_URL") %>invitation.jsp?api_key=<%= request.getAttribute("FB_API_KEY") %>&app_name=<%= request.getAttribute("FB_APP_NAME") %>&v=1.0&fb_force_mode=fbml" target="_top">Inviter des Amis</a></li>
			</ul>      
		 </div>
		 <!-- End Naviagtion -->
		 
		 <!-- Begin Content -->
		 <div id="content">
		 	  <form name="form1" id="form1" action="<%= request.getAttribute("FB_APP_URL") %>BaffesServlet" method="GET" target="_top">
		 	  
		      <table> 
	    	 <%
					int i=0;
					while(i<users.size()){
						out.println("<tr>");
						for(int j=0; j<3 && i<users.size();j++ , i++){
						User u = users.get(i);
				%>
						<td style="text-align : center">
							<input type='checkbox' name="ids" value="<%= u.getUid() %>">
							<img src='
							<% if(!u.getPicSquare().equals("")) out.print(u.getPicSquare());
								else out.print("images/nopic.jpg");	
							%>
							'/> <br/>
							<%= u.getName() %> 
					    </td>
				<%
						}
						out.println("</tr>");
				}
					
				%>
				</table>
				
				<a href="" onclick="form1.submit()"><img src="images/envoyer.png" style="padding-left : 390px" /></a>
				
				</form>
		 
		 </div>
		 <!-- End Content -->
		 
		 <!-- Begin Footer -->
		 <div id="footer">
		       
			    <jsp:include page="footer.jsp" />
			    
	     </div>
		 <!-- End Footer -->
		 
   </div>
   <!-- End Wrapper -->
	